
import http from "../index";
import { PORT1 } from "../config/servicePort";
import { User } from "../interface";
import React from "react";

export const addRole = (params:any)=>{
    return http.post<any>(PORT1 + '/role/add', params);
};
export const getRoleList = (params:User.FindPage) => {
    return http.get<User.FindPage>(PORT1 + `/role/list`, params);
};

export const deleteRole = (id:number)=>{
    return http.delete(PORT1 + `/role/del/${id}`);
};
export const setRoleMenu = (roleId: number, menuIds: React.Key[] | undefined)=>{
    return http.post(PORT1 + `/role/roleMenu/${roleId}`, menuIds);
};
export const getRoleMenu = (roleId: number)=>{
    return http.get(PORT1 + `/role/roleMenu/${roleId}`);
};
export const getAllRole = ()=>{
    return http.get(PORT1 + `/role/role_list`);
};

